<!--#include file="../conn.asp"-->
<!--#include file="../inc/const.asp"-->
<!--#include file="../inc/classmenu.asp"-->
<%
Dim HtmlContent
Newasp.LoadTemplates 9999, 7, 0

HtmlContent = Newasp.HtmlContent
HtmlContent = Replace(HtmlContent,"{$InstallDir}", Newasp.InstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", 0)
HtmlContent = Replace(HtmlContent,"{$PageTitle}",Newasp.HtmlSetting(5))
HtmlContent = ReadClassMenu(HtmlContent)
HtmlContent = ReadClassMenubar(HtmlContent)
HtmlContent = Replace(HtmlContent,"{$TempContent}", SiteClassMap)
HtmlContent = Replace(HtmlContent,"{$SiteName}", Newasp.SiteName)
HtmlContent = Replace(HtmlContent,"{$SiteUrl}", Newasp.SiteUrl)
Response.Write HtmlContent
CloseConn

Public Function SiteClassMap()
	Dim strTemp,ClassName
	Dim SQL,Rs,i
	Dim LinkTarget,strClass,ThisChannelDir,Rssfeed
	LinkTarget = " target=""_blank"""
	strClass = " class=""menubar"""
	Newasp.Name = "SiteClassMap"
	If Newasp.ObjIsEmpty() Then
		SQL = "SELECT C.ChannelID,C.ClassID,C.depth,C.ClassName,C.Readme,C.Child,C.LinkTarget,C.TurnLink,C.TurnLinkUrl,C.HtmlFileDir,C.UseHtml,C.ShowCount,B.ChannelName,B.ChannelDir,B.StopChannel,B.ModuleName,B.IsCreateHtml,B.HtmlExtName,B.SortDestination,B.BindDomain,B.DomainName FROM [NC_Classify] C INNER JOIN [NC_Channel] B On C.ChannelID=B.ChannelID WHERE B.StopChannel=0 ORDER BY C.ChannelID, C.rootid,C.orders"
		Set Rs = Newasp.Execute(SQL)
		i = 0
		strTemp = Newasp.HtmlSetting(6)
		Do While Not Rs.EOF
			ClassName = Rs("ClassName")
			If Rs("TurnLink") <> 0 Then
				ClassName = "<a href=""" & Rs("TurnLinkUrl") & """" & LinkTarget & strClass & ">" & ClassName & "</a>"
				Rssfeed = "#"
			Else
				If Rs("BindDomain") = 0 Then
					ThisChannelDir = Newasp.InstallDir & Rs("ChannelDir")
				Else
					ThisChannelDir = Trim(Rs("DomainName")) &"/"
				End If
				Rssfeed = ThisChannelDir & "rssfeed.asp?classid=" & Rs("ClassID")
				If Rs("IsCreateHtml") <> 0 Then
					ThisChannelDir = Newasp.ReadDestination(Rs("SortDestination"), Rs("ChannelDir"), "",Rs("HtmlFileDir"),Rs("ClassID"),1,1,"")
					If Rs("BindDomain") = 0 Then
						ThisChannelDir = Trim(Rs("DomainName")) & ThisChannelDir
					End If
					ClassName = "<a href=""" & ThisChannelDir & """" & LinkTarget & strClass & ">" & ClassName & "</a>"
				Else
					If IsURLRewrite Then
						ClassName = "<a href=""" & ThisChannelDir & "list_1_" & Rs("ClassID") & Rs("HtmlExtName") & """" & LinkTarget & strClass & ">" & ClassName & "</a>"
					Else
						ClassName = "<a href=""" & ThisChannelDir & "list.asp?classid=" & Rs("ClassID") & """" & LinkTarget & strClass & ">" & ClassName & "</a>"
					End If
				End If
			End If
			If Rs("depth") = 0 Then
				If i > 0 Then  strTemp = strTemp & Newasp.HtmlSetting(7)
				strTemp = strTemp & Newasp.HtmlSetting(8)
				strTemp = Replace(strTemp, "{$ClassName}", ClassName)
			Else
				strTemp = strTemp & Newasp.HtmlSetting(9)
				strTemp = Replace(strTemp, "{$ClassName}", ClassName)
			End If
				strTemp = Replace(strTemp, "{$ClassID}", Rs("ClassID"))
				strTemp = Replace(strTemp, "{$Rssfeed}", Rssfeed)
			Rs.movenext
			i = i + 1
		Loop
		strTemp = strTemp & Newasp.HtmlSetting(10)
		Rs.Close
		Set Rs = Nothing
		Newasp.Value = strTemp
	End If
	SiteClassMap = Newasp.Value
End Function
%>